package com.perfect.controller;

import com.perfect.base.BaseController;
import com.perfect.query.ReconciliationQuery;
import com.perfect.query.ShopQuery;
import com.perfect.service.ReconciliationService;
import com.perfect.vo.Reconciliation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Map;

@Controller
@RequestMapping("Merchant")
public class MerchantController extends BaseController {
    @Resource
    private ReconciliationService reconciliationService;

    //进入店铺列表界面
    @RequestMapping("reconciliation")
    public String reconciliation(){
        return "merchant/reconciliation";
    }
    //进入店铺审核界面
    @RequestMapping("audit")
    public String audit(){
        return "merchant/audit";
    }

    //进入店铺结算界面
    @RequestMapping("settle")
    public String settle(){
        return "merchant/settle";
    }





    /**
     * 返回结算数据列表
     * @param query
     * @return
     */
    @RequestMapping("list")
    @ResponseBody
    public Map<String,Object> ListSettle(ReconciliationQuery query){
//        System.out.println(query.getBillNumber());
//        System.out.println(query.getDisbursementTime());
        return reconciliationService.ListSettle(query);
    }


    /**
     * 返回数据列表
     * @param query
     * @return
     */
    @RequestMapping("listReconciliation")
    @ResponseBody
    public Map<String,Object> ListReconciliation(ReconciliationQuery query){
//        System.out.println(query.getBillNumber());
//        System.out.println(query.getDisbursementTime());
        return reconciliationService.ListReconciliation(query);
    }
}
